import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js'
import * as THREE from 'three'

export function gltf(scene) {

  const loader = new GLTFLoader();

  loader.load('./factory.glb', function(model) {
    console.log('model.scene', model.scene)
    scene.add(model.scene)


    model.scene.traverse(function(obj){
      if(obj.isMesh) {
        obj.material = new THREE.MeshStandardMaterial({
          color: 0xffffff,
          transparent: true,
          opacity: 0.8
        })
      }
    })
  })


}